
#include <cstring>
namespace CERT_FILE_PTR_DEREF_RETURN {

	namespace bad {
		typedef struct __sFILE {
			int pos;
		} FILE;

		FILE* getFile() {
			FILE* p;
			return p;
		}

		static int i = 1;
		int* getInt() {
			return &i;
		}

		void func9_function_return(void)
		{
			int x = getFile()->pos;
			FILE file1 = *getFile();
			char chr = *((char*)getFile());
		}
	}
	
	namespace good {
		typedef struct __sFILE {
			int pos;
		} FILE;

		FILE* getFile() {
			FILE* p;
			return p;
		}

		static int i = 1;
		int* getInt() {
			return &i;
		}

		void func9_function_return(void)
		{
			FILE file2 = *((FILE*)getInt());
		}
	}

}